﻿using MLSharp.Classification;

namespace MLSharp.Evaluation
{
	/// <summary>
	/// Can be used to calculate simple aggregate statistics from
	/// a dataset and a set of classification results.
	/// </summary>
	public class Summary
	{
		/// <summary>
		/// The number of correct predictions.
		/// </summary>
		public int TotalCorrect { get; private set; }

		/// <summary>
		/// Creates a new instance with the specified values.
		/// </summary>
		/// <param name="dataSet">Not used (yet).</param>
		/// <param name="results"></param>
		public Summary(IDataSet dataSet, ClassificationResult[] results)
		{
			for (int i = 0; i < results.Length; i++)
			{
				if (results[i].PredictedClass == results[i].ActualClass)
				{
					TotalCorrect++;
				}
			}
		}

	}
}
